<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/basic.css" rel="stylesheet" type="text/css" />
<title>重置密码</title>
</head>
<script>
	function checkpassword() {
		var p1 = document.getElementById("pw1").value;
		var p2 = document.getElementById("pw2").value;
		if (p2 == "" || !p2 == p1){
			document.getElementById("msg").innerHTML="两次输入的密码不一致";
			return false;
		}else
			return true;
	}
</script>
<c:if test="${pass==null }">
	<c:redirect url="login.jsp"></c:redirect>
</c:if>
<body onload="">
	<div class="top">
		<a href="home.jsp"><button>主页</button></a>
		<a href="BlogEdit?action=show"><button>我的博客</button></a>
		 <a href="writeblog.jsp"><button>上传博客</button></a>
		<a href="userinfo.jsp"><button>${pass }</button></a> <a
			href="Login?action=leave"><button>退出登录</button></a>
	</div>
	<form action="UserEdit" method="get"  onsubmit="return checkpassword()">
	<input type="hidden" name="action" value="resetPass">
		<input type="hidden" name="losername" value="${pass.name }"> <input
			type="hidden" name="rpassword" value="${pass.password }">
		<table style="position: relative; left: 40%">
			<tr>
				<td>新的密码:</td>
				<td><input type="text" id="pw1" name="password"/></td>
			<tr>
				<td>再次输入:</td>
				<td><input type="password" name="opassword" id="pw2" /><br /></td>
			</tr>
			<tr>
				<td></td>
				<td><input type="submit" name="login" value="保存" />&emsp;&emsp;
				</td>
			</tr><tr><td id="msg" colspan="2"></td></tr>
		</table>
	</form>


</body>
</html>